<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <!-- jQuery 2.2.3 -->
    <script src="/js/jquery-1.12.4.min.js"></script>
    <script src="/js/plupload/plupload.full.min.js"></script>
    <!-- iCheck -->
    <script src="/js/common.js"></script>
    <script src="/js/jquery.form.js"></script>
    <script src="/js/json2.js"></script>
    <!--[if lte IE 9]>
    <script src="/js/respond.min.js"></script>
    <script src="/js/html5shiv.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="form-group">
    <label>图片链接</label>
    <input type="text" name="link"  class="form-control" placeholder="请输入图片链接地址">
</div>
<div class="form-group">
    <label>宽度</label>
    <input type="text" name="width"  class="form-control" placeholder="默认：Auto">
</div>
<div class="form-group">
    <label>高度</label>
    <input type="text" name="height"  class="form-control" placeholder="默认：Auto">
</div>
<div class="form-group">
    <img id="thumbnail" class="img-thumbnail" alt="点击上传图片" src="" data-holder-rendered="true" style="width: 140px;">
    <input type="hidden"  name="thumbnail" value="${entity.thumbnail!''}">
</div>
<script>
    $('#thumbnail').Upload({callback:function (e,result) {
        result = JSON.parse(result);
        console.log(result);
        if(result.code == 0){
            $('#thumbnail')[0].src = result.result[0];
            $('input[name="thumbnail"]').val(result.result[0]);
            $('input[name="link"]').val(result.result[0]);
        }
    }});
</script>
</body>
</html>